package com.woniuxy.seata.storage.controller;

import com.woniuxy.seata.storage.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 作者
 * @create 2025-07-03 14:42
 */
@RequestMapping("/storage")
@RestController
public class StorageController {

    @Autowired
    StorageService storageService;

    @RequestMapping("/deduct")
    public String deduct(@RequestParam("commodityCode") String commodityCode,
                         @RequestParam("count") int count){
        storageService.deduct(commodityCode, count);
        return "storage deduct";
    }
}
